<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>聊天小助手</title>
    <link rel="stylesheet" href="./css.css">
</head>

<body>
<div class="container">
    <h4>你想说：</h4>
    <textarea name="" id="question" cols="50" rows="5"></textarea>
<!--    <label for="qty">生成图片数量:</label>-->
<!--    <select id="qty">-->
<!--        <option value="1">1</option>-->
<!--        <option value="2">2</option>-->
<!--        <option value="3">3</option>-->
<!--        <option value="4">4</option>-->
<!--        <option value="5">5</option>-->
<!--    </select>-->
    <button type="button" class="submit-btn" onclick="send()">发送</button>
    <h4>回复：</h4>
    <div id="answer">
<!--    <div id="imgs">-->
    </div>
</div>
<script src="./js/jquery-1.12.4.js"></script>
<script>
    function send() {
        var say = $("#question").val();
        var qty = $("#qty").val();
        $.post("/llm/qianfan",
            "say=" + say,
            function (data) {
                $("#answer").html(data);
                // for (var i = 0; i < data.length; i++) {
                //     $("#imgs").append('<img src="' + data[i] + '"/>')
                // }
            });
    }
    // 鼠标移动事件
    document.addEventListener('mousemove', function (e) {
        var trail = document.createElement('div');
        trail.className = 'trail';
        document.body.appendChild(trail);
        trail.style.left = e.pageX + 'px';
        trail.style.top = e.pageY + 'px';

        setTimeout(function () {
            trail.style.transform = 'scale(2)';
            trail.style.opacity = '0';
        }, 100);

        setTimeout(function () {
            document.body.removeChild(trail);
        }, 600);
    });
</script>
</body>

</html>